package org.marverse.universe

import util.{TypedKey, Checkable}

trait UniverseExtension extends Checkable {
  def advance(advancedUniverse: Universe): UniverseExtension
}

abstract class UniverseExtensionProvider[T <: UniverseExtension](clazz: Class[T]) extends TypedKey[T](clazz) {
  def createExtension(universe: Universe): T

  def addToUniverse(transaction: UniverseTransaction) {
    transaction.append(Universe.AddUniverseExtension(this))
  }
}